<!DOCTYPE html>
<html>
  <head>
    <title>四则运算</title>
  </head>
  <body>
    <input id="text" type="text">
    <span id="result"></span>

    <script src="../utils.js"></script>
    <script src="index.js"></script>
    <script>
      window.onload = () => {
        const result = document.getElementById('result');
        document.querySelector('#text').addEventListener('input', debounce(function(event) {
          result.innerText = calc(event.target.value);
        }, 1000));
      }
    </script>
  </body>
</html>
